<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
	response.setContentType("text/html;charset=UTF-8");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>我的日程管理</title>
    
  	<link rel="stylesheet" href="css/four.css" type="text/css"></link>
  	<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
  	<script type="text/javascript" src="js/four.js"></script>
  	<script type="text/javascript" src="js/hidden.js"></script>
  	<script type="text/javascript">
  		function selectAll(obj){
  			var delChose= document.getElementsByName("delChose");
  			for(var i=0;i<delChose.length;i++){
  				delChose[i].checked=obj.checked;
  			}
  		}
  		
  		function checkCbo(){
  			var chose=document.getElementsByName("delChose");
  			var btn=document.getElementById("deleteBtn");
  			for(var i=0;i<chose.length;i++){
  				if(chose[i].checked==true){
    				btn.disabled=false;
    				return;
 				 }else{
 					 btn.disabled=true;
 				 }
			}
  		}
  		
  	</script>
<script type="text/javascript" src="js/jquery-1.6.js"></script></head>
  <body>
    <div class="topTitle">
  		&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/main_28.gif"/>&nbsp;个人日程查询
  	</div>
  	<form action="searchSchedule" method="post">
  	<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="table01">
 		 <tr> 
    		<td nowrap="nowrap" class="td_scheduleNow" align="center"">  
					 日程： <input id="d5221" name="startDate" class="Wdate" type="text" onfocus="var d5222=$dp.$('d5222');WdatePicker({skin:'ext',onpicked:function(){d5222.focus();},maxDate:'#F{$dp.$D(\'d5222\')}'});checkDate()" readonly="readonly" />
						至
					  <input id="d5222" name="endDate" class="Wdate" type="text" onfocus="WdatePicker({skin:'ext',minDate:'#F{$dp.$D(\'d5221\')}'});checkDate()" readonly="readonly"/>
											  
					<input name="Submit" id="searchSubmit" type="submit" disabled="disabled" value=" 查询日程 "/>
    		</td>
  		</tr>
  	</table>
  	</form> 
  	
  	<form action="deleteTickler" method="post">
  		<table class="table_list">
 			<s:if test="ticklerList.size==0">
 				<tr> 
				    <td nowrap="nowrap" class="td_scheduleList_top" align="center">用户编号</td>
				    <td nowrap="nowrap" class="td_scheduleList_top" align="center">内容</td>
				    <td nowrap="nowrap" class="td_scheduleList_top" align="center">安排日期</td>
				    <td nowrap="nowrap" class="td_scheduleList_top" align="center">删除</td>
 				</tr>
 				<tr>
 					<td class="td_list" colspan="4" align="center">您还没安排任何日程</td>
 				</tr>
 			</s:if>
 			<s:else>
	  			<display:table name="ticklerList" id="tickler"   requestURI="/getTicklerByUserId" class="table_list" defaultorder="descending" pagesize="10">
		  			<display:column property="employee.userId" title="用户编号" headerClass="td_scheduleList_top" class="td_list"></display:column>
		  			<display:column property="content" title="内容"  headerClass="td_scheduleList_top" class="td_list" ></display:column>
		  			<display:column title="安排日期" headerClass="td_scheduleList_top" class="td_list" sortable="true">
		  				<c:if test="${ tickler.dateStr<now}">
		  					<font color="gray">${tickler.dateStr}</font>
		  				</c:if>
		  				<c:if test="${ tickler.dateStr==now}">
		  					<font color="red">${tickler.dateStr}</font>
		  				</c:if>
		  				<c:if test="${ tickler.dateStr>now}">
		  					${tickler.dateStr}
		  				</c:if>
		  			</display:column>
		  			<display:column title="删除<input type='checkbox' onclick='selectAll(this);checkCbo();' /> "  headerClass="td_scheduleList_top" class="td_list">
		  				<input type="checkbox" name="delChose" value="${tickler.id}" onclick="checkCbo()"/>
		  				
		  			</display:column>
		  		</display:table>
		  		<table class="weekTitle" cellspacing="0" cellpadding="0" width="95%" align="center">
			 	 	<tr>
			        	<td colspan="4" align="right"><input type="hidden" name="employee.userId" value="${employee.userId}" />
			        		<input value=" 删 除 " id="deleteBtn" class="buttonface" type="submit" disabled="disabled"/>&nbsp;&nbsp;&nbsp;
			        	</td>
			    	</tr>
	  			</table>
 			</s:else>
  		</table>
  		</form>
  </body>
</html>
